package com.jida.hadoop.mr.datamatch;


import java.util.Comparator;
 
public class StringComparator implements Comparator<String> {
    //匹配级别， 先匹配三级--> 二级  -->一级
    public int compare(String k1, String k2) {
        k1 = k1.split(",")[1];
        k2 = k2.split(",")[1];
        if (Integer.parseInt(k2) - Integer.parseInt(k1) == 0) {
            return -1;
        } else {
            return Integer.parseInt(k2)- Integer.parseInt(k1);//k2-k1   降序
        }
    }
}
